home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / hiz / 09 / 09.exe / adynware.exe / perl / lib / site / Win32 / Service.pm < prev    next >
Encoding:
Perl POD Document  |  1999-12-28  |  1.6 KB  |  96 lines

  1. package Win32::Service;
  2.  
  3.  
  4. $VERSION = '0.01';
  5.  
  6. require Exporter;
  7. require DynaLoader;
  8.  
  9. die "The Win32::Service module works only on Windows NT" if(!Win32::IsWinNT());
  10.  
  11. @ISA= qw( Exporter DynaLoader );
  12. @EXPORT = qw(
  13.     );
  14.  
  15. =head1 NAME
  16.  
  17. Win32::Service - manage system services in perl
  18.  
  19. =head1 SYNOPSIS
  20.  
  21.     use Win32::Service;
  22.  
  23. =head1 DESCRIPTION
  24.  
  25. This module offers control over the administration of system services.
  26.  
  27. =head1 FUNCTIONS
  28.  
  29. =head2 NOTE:
  30.  
  31. All of the functions return FALSE (0) if they fail, unless otherwise noted.
  32. If hostName is an empty string, the local machine is assumed.
  33.  
  34. =over 10
  35.  
  36. =item StartService(hostName, serviceName)
  37.  
  38. Start the service serviceName on machine hostName.
  39.  
  40. =item StopService(hostName, serviceName)
  41.  
  42. Stop the service serviceName on the machine hostName.
  43.  
  44. =item GetStatus(hostName, serviceName, status) 
  45.  
  46. Get the status of a service.
  47.  
  48. =item PauseService(hostName, serviceName)
  49.  
  50. =item ResumeService(hostName, serviceName)
  51.  
  52. =item GetServices(hostName, list) 
  53.  
  54. =back
  55.  
  56. =cut
  57.  
  58. sub AUTOLOAD
  59. {
  60.  
  61.     my($constname);
  62.     ($constname = $AUTOLOAD) =~ s/.*:://;
  63.     $!=0;
  64.     my $val = constant($constname);
  65.     if($! != 0)
  66.     {
  67.         if($! =~ /Invalid/)
  68.         {
  69.             $AutoLoader::AUTOLOAD = $AUTOLOAD;
  70.             goto &AutoLoader::AUTOLOAD;
  71.         }
  72.         else
  73.         {
  74.             ($pack,$file,$line) = caller;
  75.             die "Your vendor has not defined Win32::Service macro $constname, used in $file at line $line.";
  76.         }
  77.     }
  78.     eval "sub $AUTOLOAD { $val }";
  79.     goto &$AUTOLOAD;
  80. }
  81.  
  82. bootstrap Win32::Service;
  83.  
  84. 1;
  85. __END__
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.